//
// Created by xiaoma on 1/28/21.
//

#ifndef HORSE_VM_HIOBJECT_H
#define HORSE_VM_HIOBJECT_H

#include "Klass.h"

class HiBool;

class HiObject {
public:
    void setKlass(Klass *klass) { _klass = klass; }

    const Klass *klass() { return _klass; }

    void print() { _klass->print(this); }

    HiObject *add(HiObject *object) { _klass->add(this, object); }

    HiBool *less(HiObject *rhs) { _klass->less(this, rhs); }

    HiBool *lessEqual(HiObject *rhs) { _klass->lessEqual(this, rhs); }

    HiBool *equal(HiObject *rhs) { _klass->equal(this, rhs); }

    HiBool *notEqual(HiObject *rhs) { _klass->notEqual(this, rhs); }

    HiBool *greater(HiObject *rhs) { _klass->greater(this, rhs); }

    HiBool *greaterEqual(HiObject *rhs) { _klass->greaterEqual(this, rhs); }

private:
    Klass *_klass;
};

#endif //HORSE_VM_HIOBJECT_H
